package org.example.demosr5.mapper;

import org.apache.ibatis.annotations.*;
import org.example.demosr5.entity.Student;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Mapper
public interface StudentMapper {
    @Select("select *from student where number=#{number}")
    Student findByNumber(String number);

    @Delete("delete from student where number=#{number}")
    int deleteByNumber(String number);

    @Insert("insert into student(number,name) values (#{number},#{name})")
    int createBynumber(String number, String name);

    @Update("update student set name=#{name} where number=#{number}")
    int updateByNumber(String number, String name);
}
